package _base0;

/**
 * 1281. 整数的各位积和之差
 */
public class No1281 {
    public int subtractProductAndSum(int n) {
        int acc = 1, sum = 0;
        while (n > 0) {
            int remainder = n % 10;
            acc *= remainder;
            sum += remainder;
            n /= 10;
        }
        return acc - sum;
    }
}
